import request from '@/plugins/request'

export const fetchMessages = (data) => {
  return request({
    url: '/messages/findMessage',
    method: 'post',
    data
  })
}

export const fetchNoticeMessages = (data) => {
  return request({
    url: '/messages/findNoticeMessage',
    method: 'post',
    data
  })
}

export const createMessage = (data) => {
  return request({
    url: '/messages/createMessage',
    method: 'post',
    data
  })
}

export const updateMessage = (data) => {
  return request({
    url: '/messages/updateMessage',
    method: 'post',
    data
  })
}

export const deleteMessage = (data) => {
  return request({
    url: '/messages/delete',
    method: 'post',
    data
  })
}

export const clearAllHasReadMessage = (data) => {
  return request({
    url: '/messages/clearAll',
    method: 'post',
    data
  })
}

export const clearAllMessages = (data) => {
  return request({
    url: '/messages/readAll',
    method: 'post',
    data
  })
}
